#pragma once

#include "Cell.h"
#include "Bullet.h"
#include "Tank.h"
#include "GameField.h"
#include <list>
#include <QDebug>

class GameData
{
public:
   GameData()
   {
       my_id = -1;
   }

   void DrawAll()
   {
      if (field)
      {
         field->DrawAll();
      }
      for (std::list<Tank>::iterator iter = tanks.begin(); iter != tanks.end(); iter++)
      {
          //qDebug()<<"before update tanks";
         iter->update();
      }
      for (std::list<Bullet>::iterator iter = bullets.begin(); iter != bullets.end(); iter++)
      {
         iter->update();
      }
   }

public:
   QString my_nick;
   int my_id;
   std::list<Tank> tanks;
   GameField * field;
   std::list<Bullet> bullets;
};
